<html>
	<head>
		<meta charset="UTF-8">
		<link type="text/css" href="css/xgmm.css" rel="stylesheet">
	</head>
	<body>
	<h2 >修改密码</h2>
	  
	<div id="center">
		
	<div class="input-group">
		 
		<span style="font-family: 楷体; font-size: 20px;" > 
			 原&nbsp;密&nbsp;码：
		</span>
		<input  id="pwdId" name="password" type="text" style="height:25px" value="">
	</div>
	<div class="input-group">
		 <span style="font-family: 楷体; font-size: 20px;">
		 	 新&nbsp;密&nbsp;码：
		 </span>
		<input  id="newPwdId" name="newPwd" type="text" style="height:25px" value="" >
	</div>
	<div class="input-group">
		  <span style="font-family: 楷体; font-size: 20px;">
		  	 确认密码：
		  </span>
		<input  id="cfgPwdId" name="cfgPwd" type="text" style="height:25px" value=""  >
	</div>
	<div id="btn" class="box-footer" style="padding-top: 50px">
		<a>
			<input class="btn1 btn-cancel" type="button" value="返回">
		</a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a >
			<input class="btn2 btn-save" type="button" value="确认">
		</a>
	</div>
	</div>
	<script type="text/javascript">
		$(function(){
			$(".box-footer")
					.on("click",".btn-cancel",doCancel)
					.on("click",".btn-save",doUpdateObject)
		});
		function doCancel(){
			$("#mainContentId").html("");
		}
		function doUpdateObject(){
			//1.获取用户提交数据
			var params={pwd:$("#pwdId").val(),
				newPwd:$("#newPwdId").val(),
				cfgPwd:$("#cfgPwdId").val()
			}
			//2.定义请求的url
			var url="doUpdatePassword"
			//3.异步提交请求,执行更新操作
			$.post(url,params,function(result){
				if(result.state==1){
					alert("修改成功，请重新登录");
					location.href="doLogin?t="+Math.random();
				}else{
					alert(result.message);
				}
			})
		}
	</script>
		    
	</body>
</html>
